<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
  String companyNum=request.getParameter("companyNum");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>新建部门</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>/style/main.css" rel="stylesheet"
			type="text/css" />
    <link href="<%=basePath%>/style/jquery-ui-1.8.16.custom.css" rel="stylesheet"
			type="text/css" />
		<link type="text/css" rel="stylesheet" href="<%=basePath%>/style/style.css" />
	<script src="<%=basePath%>/Scripts/jquery-1.3.1.js" type="text/javascript"></script>
	<script src="<%=basePath%>/Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="<%=basePath%>/Scripts/jquery.validate.js" type="text/javascript"></script>
    <script src="<%=basePath%>/Scripts/ui.datepicker-zh_CN.js" type="text/javascript"></script>
	<style>
	body{ padding:10px}
	.mydiv input {
		width: 160px;
		font-size: 15pt;
		border: solid 1px #7F9DB9;
		padding: 8px 10px;
		font-size: 15px;	
       }
	.mydiv{
	background-color: #F1F6FF;
	padding: 10px;
	 border:1px solid #5BA8DE;
	}
	.mydiv legend{
	font-size: 20px;	
	}
	label { width: 10em; float: left; }
		label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
		em { font-weight: bold; padding-right: 1em; vertical-align: top; }
		em.error {
		  background:url("<%=basePath%>/images/unchecked.gif") no-repeat 0px 0px;
		  padding-left: 16px;
		}
		em.success {
		  background:url("<%=basePath%>/images/checked.gif") no-repeat 0px 0px;
		  padding-left: 16px;
		}
	</style>
	<script type="text/javascript">
		function datePicker(pickerName,locale) {
		$(pickerName).datepicker($.datepicker.regional[locale]);
		$(pickerName).datepicker('option', 'changeMonth', true);//月份可调
		$(pickerName).datepicker('option', 'changeYear', true);//年份可调
		
	}
	 $(function(){
  datePicker('#dcdate','zh_CN');
  $("#SubCompanyMessage").validate({
		rules: {
			departmentId: { 
				required: true,
				minlength: 6
			},
			departNameC:{
			required:true,
			minlength:4
			},
			departNameE:{
			required:true,
			minlength:4
			},			
			dposeCode:{
			required:true,
			minlength:4
			},
			daddress:{
			required:true,
			minlength:4
			},
			dfax:{
			required:true,
			minlength:6
			},
			dphone:{
			required:true,
			minlength:6
			},
			dfax:{
			required:true,
			minlength:6
			},
			demail: {
				required: true,
				email: true
			},
			dcrMan:{
			required:true,
			minlength:3
			},
			shortName:{
			required:true,
			minlength:3
			},
			dcdate:{
			reguired:true,
			date:true
			}
		},
		messages: {
			departmentId: {
				required: '请输入部门编号',
				minlength: '编号至少六位，字母+数字'
			},
			departNameC: {
				required: '请输入部门中文名称',
				minlength: '至少四个字符'
			},
			departNameE: {
			required:'请输入部门英文名',
			minlength:'至少四个字符'
			},
			daddress: {
			required:'请输入部门地址',
			minlength:'至少四个字符'
			},
			dfax:{
			required:'请输入部门传真',
			minlength:'至少六位'
			},
			stelephone:{
			required:'请输入公司电话',
			minlength:'至少8位'
			},
			dposeCode:{
			required:'请输入公司邮编',
			minlength:'至少6位'
			},
			sfax:{
			required:'请输入公司传真',
			minlength:'至少6位'
			},
			demail: {
				required: '请输入部门Email',
				email:'请输入正确的Email地址'
			},
			dcrMan:{
			required:'请输入部门负责人',
			minlength:'至少两个字'
			},
			shortName:{
			required:'请输入部门简称',
			minlength:'至少4个字符'
			},
			dcdate:{
			required:'请输入成立日期',
			data:'请输入正确的日期格式'
			}
		},	
		
		errorElement: "em", //可以用其他标签，记住把样式也对应修改
		success: function(label) {
			//label指向上面那个错误提示信息标签em
			label.text(" ")				//清空错误提示消息
				.addClass("success");	//加上自定义的success类
		}
	  });});
	
	</script>
  </head>
  
  <body>
<div id="subCompanyDiv" class="mydiv">
    <form id="SubCompanyMessage" action="AddDepatemtment" method="post">
     <fieldset class="myfieldset">
   <div class="FuckTittle"><span class="title">基本资料</span></div>
      <p>&nbsp;</p>
      <div class="table4">
    <input type="hidden" id="companyNum" name="companyNum" value="<%=companyNum %>"/>
    <p>
    <label for="departmentId">部门编号：</label><input type="text" name="departmentId" id="departmentId"/>&nbsp;&nbsp;&nbsp;&nbsp;
    部门简称：<input type="text" id="shortName" name="shortName"/>
    </p><p>&nbsp;</p>
    <p>
     <label for="departNameC">部门名称(中)：</label><input type="text" name="departNameC" id="departNameC"/>&nbsp;&nbsp;&nbsp;&nbsp;
     英文名称：<input type="text" id="departNameE" name="departNameE"/>
    </p><p>&nbsp;</p>
     <p>
     <label for="daddress">详细地址：</label><input type="text" name="daddress" id="daddress"/>&nbsp;&nbsp;&nbsp;&nbsp;
     邮&nbsp;&nbsp;&nbsp;&nbsp;编：<input type="text" id="dposeCode" name="dposeCode"/>
    </p><p>&nbsp;</p>
    <p>
     <label for="demail">部门邮箱：</label><input type="text" name="demail" id="demail"/>&nbsp;&nbsp;&nbsp;&nbsp;
     部门电话：<input type="text" id="dphone" name="dphone"/>
    </p><p>&nbsp;</p>
     <p>
     <label for="dcrMan">负责人：</label><input type="text" name="dcrMan" id="dcrMan"/>&nbsp;&nbsp;&nbsp;&nbsp;
     创建时间：<input type="text" id="dcdate" name="dcdate"/>
    </p><p>&nbsp;</p>
     <p>
     <label for="dfax">部门传真：</label><input type="text" name="dfax" id="dfax"/>&nbsp;&nbsp;&nbsp;&nbsp;
    </p><p>&nbsp;</p>
    <p >
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="input" type="submit"  value="保存"  class="btn_1" />&nbsp;&nbsp; <input name="input" type="reset"  value="重置"  class="btn_1" onclick="test2()"/>
    </p></div>
    </fieldset>
   </form>
   </div>   
  </body>
</html>
